#!/bin/bash

gateway_ip_list="20.1.5.15 20.1.5.16 20.1.5.18 20.1.5.22 20.1.5.30"

function main() {

for ip in $gateway_ip_list
do

result=`curl http://$ip:9100/metrics|grep node_processes_threads|grep -vE 'TYPE|HELP|Total'|awk '{print $2}'`

if [ $result -gt 31439 ]
then
   echo host $ip  process threads exception,the node process threads num is $result and too larger than normal,please check it
   exit
fi

done

echo success

}

main


